<!-- 网站设置 -->
<template>
    <div class='bgff h100 pd pt10 dfgfdgtrt'>
        <p class="title-label">网站设置</p>
        <div class="mt20 sdfgdgdfyt">
            <n-form ref="formRef" label-width="120" :inline="false" size="normal" label-placement="left">
                <n-form-item label="系统名称:" path="" class="mt20">
                    <n-input v-model:value="formValue.name" type="text" placeholder="请输入系统名称" size="medium" clearable></n-input>
                </n-form-item>
                <n-form-item label="视频ip:" path="" class="mt20">
                    <n-input v-model:value="formValue.ip" type="text" placeholder="请输入视频ip" size="medium" clearable></n-input>
                </n-form-item>
                <n-form-item label="&nbsp;" path="" class="mt20">
                    <n-button type="primary" size="medium" @click="saveFun">保存</n-button>
                </n-form-item>

            </n-form>

        </div>



    </div>
</template>
<script lang='ts' setup>
import { ref } from "vue"
import { callBack, dxpost, qurl, dxget } from "../../util/index"
const id = 1
const formValue = ref({
    name:"",
    ip: "",
})

const initData = async()=>{
    const {data}:any =  await dxget('jk/jkconfig',{id})
    const dataw = JSON.parse(data.data)
    if(dataw.name){
        formValue.value.name = dataw.name
    }
    if(dataw.ip){
        formValue.value.ip = dataw.ip
    }
    
}
initData()
const saveFun = async()=>{
  const {errno}:any =  await dxpost('jk/jkconfig',{id,data:JSON.stringify(formValue.value)},'put')
  if(errno==0){
    window.$message.success('保存成功！')
  }
}


</script>
<style scoped>
.dfgfdgtrt{
    overflow: auto;
    padding-bottom: 40px;
}
.sdfgdgdfyt {
    width: 600px;
}

</style>